package com.gimi.cloud.bbp.app.consumer.feign;

import feign.Headers;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.util.MultiValueMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * 通用接口fegin
 *
 * @author wbj
 * @version 1.0
 * @Description
 * @create 2018-01-26
 *
 */
@FeignClient(name = "bbp-app-service")
public interface PublicFeignService {
    /**
     * 上传文件
     * @param multipartFiles 待上传的文件
     * @param  type 文件类型，见sys_config
     * @param  extra 额外参数，原封返回
     * @return 上传文件结果
     */
    @Headers({"Content-Type: mutipart/form-data","Accept: application/json"})
    @RequestMapping(value = "/public/fileupload", method = RequestMethod.POST)
    String fileUpload(MultiValueMap multipartFiles, @RequestParam("type") String type, @RequestParam("extra") String extra);

    /**
     * 获取文件路径
     * @param fileName 文件名称
     * @return 获取结果
     */
    @Headers({"Content-Type: application/json","Accept: application/json"})
    @RequestMapping(value = "/public/getFilePath", method = RequestMethod.POST)
    String getFilePath(@RequestParam("fileName") String fileName);
}
